/*
 * formularioFamilia.java
 *
 * Created on 24/02/2011, 14:59:47
 */

package pbf.dialog;

import pbf.conf.hibernate.entidades.Familia;
import pbf.conf.hibernate.entidades.Localidade;

/**
 *
 * @author Ricardo
 */
public class DetalhesFamilia extends javax.swing.JDialog
{
    public DetalhesFamilia(java.awt.Frame parent, boolean modal)
    {
        super(parent, modal);
        initComponents();
    }

    public void setFormulario(Familia familia, Localidade localidade)
    {
        familiaNome.setText(familia.getFamiliaNome());
        familiaCelular.setText(familia.getFamiliaCelular());
        familiaBeneficiario.setText(familia.getFamiliaBeneficiario().equals("N")? "Não":"Sim");
        familiaComplemento.setText(familia.getFamiliaComplementoEndereco());
        familiaCpf.setText(familia.getFamiliaCpf());
        familiaTitulo.setText(familia.getFamiliaTitulo());
        familiaIdentidade.setText(familia.getFamiliaIdentidade());
        familiaTelefone.setText(familia.getFamiliaTelefone());
        familiaNis.setText("" + familia.getFamiliaNis());
        familiaEndereco.setText(familia.getFamiliaEndereco());
        familiaNumPessoas.setText("" + familia.getFamiliaNPessoas());
        familiaSexo.setText(familia.getFamiliaSexo().equals("M")? "Masculino":"Feminino");
        familiaLocalidade.setText(localidade.getLocalidadeNome());
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel11 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jScrollPane9 = new javax.swing.JScrollPane();
        familiaComplemento = new javax.swing.JTextArea();
        jSeparator2 = new javax.swing.JSeparator();
        jButton1 = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        familiaTitulo = new javax.swing.JTextField();
        familiaLocalidade = new javax.swing.JTextField();
        familiaIdentidade = new javax.swing.JTextField();
        familiaCpf = new javax.swing.JTextField();
        familiaNumPessoas = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        familiaNome = new javax.swing.JTextField();
        familiaBeneficiario = new javax.swing.JTextField();
        familiaCelular = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        familiaTelefone = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        familiaNis = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        familiaSexo = new javax.swing.JTextField();
        familiaEndereco = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(null);

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel1.setText("Nome do Responsável:");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(20, 50, 180, 20);

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel3.setText("CPF:");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(20, 100, 33, 20);

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel5.setText("Titulo:");
        getContentPane().add(jLabel5);
        jLabel5.setBounds(150, 100, 60, 20);

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel7.setText("Beneficiario:");
        getContentPane().add(jLabel7);
        jLabel7.setBounds(290, 100, 110, 20);

        jLabel9.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel9.setText("Identidade:");
        getContentPane().add(jLabel9);
        jLabel9.setBounds(20, 150, 100, 20);
        getContentPane().add(jSeparator1);
        jSeparator1.setBounds(20, 40, 400, 10);

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel11.setText("Endereço:");
        getContentPane().add(jLabel11);
        jLabel11.setBounds(10, 290, 90, 20);

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel13.setText("Localidade:");
        getContentPane().add(jLabel13);
        jLabel13.setBounds(10, 320, 80, 20);

        jLabel14.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel14.setText("N° pessoas da família:");
        getContentPane().add(jLabel14);
        jLabel14.setBounds(10, 350, 159, 20);

        jLabel18.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel18.setText("Complemento do endereço:");
        getContentPane().add(jLabel18);
        jLabel18.setBounds(10, 380, 410, 30);

        familiaComplemento.setColumns(20);
        familiaComplemento.setEditable(false);
        familiaComplemento.setFont(new java.awt.Font("Arial", 0, 14));
        familiaComplemento.setRows(5);
        familiaComplemento.setText("Reside ao lado do bar raio de sol.");
        jScrollPane9.setViewportView(familiaComplemento);

        getContentPane().add(jScrollPane9);
        jScrollPane9.setBounds(10, 410, 410, 100);
        getContentPane().add(jSeparator2);
        jSeparator2.setBounds(0, 520, 440, 10);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/pbf/imagens/cross-circle.png"))); // NOI18N
        jButton1.setText("Fechar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        getContentPane().add(jButton1);
        jButton1.setBounds(320, 530, 100, 25);

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 16));
        jLabel16.setText("Dados do Responsável Família");
        getContentPane().add(jLabel16);
        jLabel16.setBounds(20, 20, 320, 20);

        familiaTitulo.setEditable(false);
        familiaTitulo.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaTitulo.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaTitulo.setText("012.665.751-89");
        getContentPane().add(familiaTitulo);
        familiaTitulo.setBounds(150, 120, 130, 23);

        familiaLocalidade.setEditable(false);
        familiaLocalidade.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaLocalidade.setText("Centro");
        getContentPane().add(familiaLocalidade);
        familiaLocalidade.setBounds(100, 320, 320, 23);

        familiaIdentidade.setEditable(false);
        familiaIdentidade.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaIdentidade.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaIdentidade.setText("487.998.5755");
        getContentPane().add(familiaIdentidade);
        familiaIdentidade.setBounds(20, 170, 120, 23);

        familiaCpf.setEditable(false);
        familiaCpf.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaCpf.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaCpf.setText("012.665.751-89");
        getContentPane().add(familiaCpf);
        familiaCpf.setBounds(20, 120, 120, 23);

        familiaNumPessoas.setEditable(false);
        familiaNumPessoas.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaNumPessoas.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaNumPessoas.setText("2");
        getContentPane().add(familiaNumPessoas);
        familiaNumPessoas.setBounds(180, 350, 240, 23);

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 16));
        jLabel17.setText("Endereço da Família");
        getContentPane().add(jLabel17);
        jLabel17.setBounds(10, 260, 320, 20);
        getContentPane().add(jSeparator3);
        jSeparator3.setBounds(10, 280, 410, 10);

        familiaNome.setEditable(false);
        familiaNome.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaNome.setText("Ricardo Tavares Antunes de Oliveira");
        getContentPane().add(familiaNome);
        familiaNome.setBounds(20, 70, 400, 23);

        familiaBeneficiario.setEditable(false);
        familiaBeneficiario.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaBeneficiario.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaBeneficiario.setText("Sim");
        getContentPane().add(familiaBeneficiario);
        familiaBeneficiario.setBounds(290, 120, 130, 23);

        familiaCelular.setEditable(false);
        familiaCelular.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaCelular.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaCelular.setText("(63) 3356-1155");
        getContentPane().add(familiaCelular);
        familiaCelular.setBounds(290, 170, 130, 23);

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel4.setText("Celular:");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(290, 150, 100, 20);

        familiaTelefone.setEditable(false);
        familiaTelefone.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaTelefone.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaTelefone.setText("(63) 3356-1155");
        getContentPane().add(familiaTelefone);
        familiaTelefone.setBounds(150, 170, 130, 23);

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel6.setText("Telefone: ");
        getContentPane().add(jLabel6);
        jLabel6.setBounds(150, 150, 100, 20);

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel10.setText("NIS:");
        getContentPane().add(jLabel10);
        jLabel10.setBounds(20, 200, 100, 20);

        familiaNis.setEditable(false);
        familiaNis.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaNis.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaNis.setText("1112.6857.985");
        getContentPane().add(familiaNis);
        familiaNis.setBounds(20, 220, 120, 23);

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 16));
        jLabel12.setText("Sexo:");
        getContentPane().add(jLabel12);
        jLabel12.setBounds(150, 200, 100, 20);

        familiaSexo.setEditable(false);
        familiaSexo.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaSexo.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        familiaSexo.setText("487.998.5755");
        getContentPane().add(familiaSexo);
        familiaSexo.setBounds(150, 220, 130, 23);

        familiaEndereco.setEditable(false);
        familiaEndereco.setFont(new java.awt.Font("Tahoma", 0, 14));
        familiaEndereco.setText("Av. Napoleão de Queiroz");
        getContentPane().add(familiaEndereco);
        familiaEndereco.setBounds(100, 290, 320, 23);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-449)/2, (screenSize.height-606)/2, 449, 606);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                DetalhesFamilia dialog = new DetalhesFamilia(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField familiaBeneficiario;
    private javax.swing.JTextField familiaCelular;
    private javax.swing.JTextArea familiaComplemento;
    private javax.swing.JTextField familiaCpf;
    private javax.swing.JTextField familiaEndereco;
    private javax.swing.JTextField familiaIdentidade;
    private javax.swing.JTextField familiaLocalidade;
    private javax.swing.JTextField familiaNis;
    private javax.swing.JTextField familiaNome;
    private javax.swing.JTextField familiaNumPessoas;
    private javax.swing.JTextField familiaSexo;
    private javax.swing.JTextField familiaTelefone;
    private javax.swing.JTextField familiaTitulo;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    // End of variables declaration//GEN-END:variables

}
